package com.ducanh.doan.utils;

import java.io.IOException;
import java.io.InputStream;

public class IOUtils {
	
	public static String convertStreamToString(InputStream is) {
		StringBuilder out = new StringBuilder();
		int byteRead = 0;
		byte[] buffer = new byte[8096];
//		int totalRead = 0;
		try {
			while((byteRead = is.read(buffer)) != -1) {
				out.append(new String(buffer, 0, byteRead));
//				totalRead += byteRead;
			}
			is.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return out.toString();
	}
	
}
